package mta.localization;

import mta.io.LocalizationPackageFiles;
import mta.io.LocalizationPackageFilesIF;
import mta.io.csv.reader.CsvTranslationReaderFactory;
import mta.io.csv.reader.CsvTranslationReaderFactoryIF;

/**
 * Magento Translation Assistant
 * Copyright (c) 2009 Dmitry Nikolaev
 * Contact author: blackliteon@gmail.com
 */
public class LocalizationPackageFactory {
    public LocalizationPackage build(String path) {
        CsvTranslationReaderFactoryIF readerFactory = new CsvTranslationReaderFactory();
        LocalizationPackageFilesIF destFiles = new LocalizationPackageFiles(path);
        try {
            return new LocalizationPackageBuilder(destFiles, readerFactory).
                    buildLocalizationFactory();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
